import Vue from 'vue';
import Vuex from 'vuex';
Vue.use(Vuex);
const store = new Vuex.Store({  
  state: { 
	  isPlay:false,//是否播放
	  document:undefined,
	  isBall:false, //是否展示悬浮球
	  key:0,
	  timesAll:0,
	  timesHms:'00:00'
  },  
  mutations: { 
    setPlay(state,value) {  
      state.isPlay = true;
    },
	setBall(state,value) {
		state.isBall = value;
	},
	setDocument(state,value) {
		state.document = value;
	},
	setKey(state,value) {
		state.key = state.key + 1;
	},
	setTimes(state,value){
		state.timesAll = value;
	},
	setTimeHms(state,value) {
		state.timesHms = value;
	}
  },
  actions:{
  	activeSetBall(context,val) {
  		console.log('contextxxxxxxx',context,val)
  		context.commit('setBall',val);
  	},
  }
}) 

export default store